﻿<%@ Page Title="Home Page" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false"
    CodeBehind="Default.aspx.vb" Inherits="Car._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        &nbsp;</h2>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
    DataSourceID="CarSqlDataSource" AllowSorting="True" Width="639px" 
        Height="109px">
    <Columns>
        <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
            ReadOnly="True" SortExpression="ID" />
        <asp:HyperLinkField DataNavigateUrlFields="ID" 
            DataNavigateUrlFormatString="Detail.aspx?ID={0}" DataTextField="Manufacturer" 
            HeaderText="Manufacturer">
        </asp:HyperLinkField>
        <asp:HyperLinkField DataNavigateUrlFields="Website" 
            DataNavigateUrlFormatString="{0}" DataTextField="Website" HeaderText="Website">
        <ControlStyle CssClass="carPicture" />
        </asp:HyperLinkField>
        <asp:BoundField DataField="Model" HeaderText="Model" SortExpression="Model">
        <ControlStyle CssClass="carPicture" />
        </asp:BoundField>
        <asp:HyperLinkField DataNavigateUrlFields="PostCode" 
            DataNavigateUrlFormatString="https://maps.google.co.uk/maps?q={0}" 
            DataTextField="PostCode" HeaderText="PostCode">
        <ControlStyle CssClass="carPicture" />
        </asp:HyperLinkField>
        <asp:ImageField DataAlternateTextField="Picture" 
            DataAlternateTextFormatString="{0}" DataImageUrlField="Picture" 
            HeaderText="Pictures">
            <ControlStyle CssClass="carPicture" />
        </asp:ImageField>
        <asp:BoundField DataField="SafetyRating" HeaderText="SafetyRating" 
            SortExpression="SafetyRating" />
    </Columns>
</asp:GridView>
<asp:SqlDataSource ID="CarSqlDataSource" runat="server" 
    ConnectionString="<%$ ConnectionStrings:CarsConnectionString %>" 
    ProviderName="<%$ ConnectionStrings:CarsConnectionString.ProviderName %>" 
    
        
        SelectCommand="SELECT [ID], [Manufacturer], [Model], [Website], [Contact], [Picture], [PostCode], [SafetyRating] FROM [Car] ORDER BY [ID]">
</asp:SqlDataSource>
</asp:Content>
